package rus.dao.hibernate;

import rus.dao.ProductCategoryDAO;
import rus.model.ProductCategory;

public class ProductCategoryDAOHibernate extends GenericDaoHibernate<ProductCategory, Integer> implements ProductCategoryDAO{

	public ProductCategoryDAOHibernate() {
		super(ProductCategory.class);
	}

	public ProductCategory saveProductCategory(ProductCategory productCategory) {
		getHibernateTemplate().saveOrUpdate(productCategory);
        // necessary to throw a DataIntegrityViolation and catch it in UserManager
        getHibernateTemplate().flush();
        return productCategory;
	}

}
